<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      let salaries = {
        John: 100,
        Pete: 300,
        Mary: 250,
      };
      function sumSalaries(obj = {}) {
        const values = Object.values(obj);
        let sum = 0;
        for (let v of values) sum += v;
        return sum;
      }
      console.log(sumSalaries(salaries)); // 650
    </script>
  </body>
</html>
